<template>
  <div>
      <van-card
      v-for="(item, index) in list"
      :key="index" 
      :price="item.minPrice"
      :desc="item.characteristic"
      :title="item.name"
      :thumb="item.pic"
      :origin-price="item.originalPrice"
      v-show="index >= 5 "
      @click="gotodetail(item.id)"
    />
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  methods: {
    gotodetail(id){
this.$router.push({path:'/bargaindetail',query:{id}})
    }
  },
  mounted() {
    this.$API
      .getList()
      .then((rel) => {
        console.log(rel);
        this.list = rel.data.data;
      })
      .catch((err) => {
        console.log(err);
      });
  },
};
</script>